<?php

require_once dirname(__FILE__) . '/../../Extension/Params.php';
require_once dirname(__FILE__) . '/TextValues.php';

class Rams_Extension_TrafficParams extends Raws_Extension_Params
{
  
  // protected $_rootNamespace = 'raws';
  // protected $_rootElement = 'params';

    # child elements of the params element
    protected $_path = null;
    protected $_volume = null;
    protected $_hits = null;
    protected $_updated = null;

    protected $_pct_0_10 = null;
    protected $_pct_10_20 = null;
    protected $_pct_20_30 = null;
    protected $_pct_30_40 = null;
    protected $_pct_40_50 = null;
    protected $_pct_50_60 = null;
    protected $_pct_60_70 = null;
    protected $_pct_70_80 = null;
    protected $_pct_80_90 = null;
    protected $_pct_90_100 = null;
    protected $_pct_unknown = null;

    protected $_time0 = null;
    protected $_time1 = null;
    protected $_time2 = null;
    protected $_time3 = null;
    protected $_time4 = null;
    protected $_time5 = null;
    protected $_time6 = null;
    protected $_time7 = null;
    protected $_time8 = null;
    
    protected $_sec_avg = null;
    protected $_sec_total = null;
    protected $_last_request = null;
    

    public function __construct($path = null, $volume = null, $hits = null, $updated = null) 
    {
        parent::__construct();
        $this->setPath($path);
        $this->setVolume($volume);
        $this->setHits($hits);
        $this->setUpdated($updated);
    }
    
    /**
     * Retrieves a DOMElement which corresponds to this element and all
     * child properties.  This is used to build an entry back into a DOM
     * and eventually XML text for application storage/persistence.
     *
     * @param DOMDocument $doc The DOMDocument used to construct DOMElements
     * @return DOMElement The DOMElement representing this element and all
     *          child properties.
     */
    public function getDOM($doc = NULL, $majorVersion = 1, $minorVersion = NULL)
    {
        $element = parent::getDOM($doc);
        if ($this->_path !== null) {
            $element->appendChild($this->_path->getDOM($element->ownerDocument));
        }
        if ($this->_volume !== null) {
            $element->appendChild($this->_volume->getDOM($element->ownerDocument));
        }
        if ($this->_hits !== null) {
            $element->appendChild($this->_hits->getDOM($element->ownerDocument));
        }
        if ($this->_updated !== null) {
            $element->appendChild($this->_updated->getDOM($element->ownerDocument));
        }
        
        if ($this->_pct_0_10 != null) {
            $element->setAttribute('pct_0_10', $this->_pct_0_10);
        }
        if ($this->_pct_10_20 != null) {
            $element->setAttribute('pct_10_20', $this->_pct_10_20);
        }
        if ($this->_pct_20_30 != null) {
            $element->setAttribute('pct_20_30', $this->_pct_20_30);
        }
        if ($this->_pct_30_40 != null) {
            $element->setAttribute('pct_30_40', $this->_pct_30_40);
        }
        if ($this->_pct_40_50 != null) {
            $element->setAttribute('pct_40_50', $this->_pct_40_50);
        }
        if ($this->_pct_50_60 != null) {
            $element->setAttribute('pct_50_60', $this->_pct_50_60);
        }
        if ($this->_pct_60_70 != null) {
            $element->setAttribute('pct_60_70', $this->_pct_60_70);
        }
        if ($this->_pct_70_80 != null) {
            $element->setAttribute('pct_70_80', $this->_pct_70_80);
        }
        if ($this->_pct_80_90 != null) {
            $element->setAttribute('pct_80_90', $this->_pct_80_90);
        }
        if ($this->_pct_90_100 != null) {
            $element->setAttribute('pct_90_100', $this->_pct_90_100);
        }
        if ($this->_pct_unknown != null) {
            $element->setAttribute('pct_unknown', $this->_pct_unknown);
        }

        if ($this->_time0 != null) {
            $element->setAttribute('time0', $this->_time0);
        }
        if ($this->_time1 != null) {
            $element->setAttribute('time1', $this->_time1);
        }
        if ($this->_time2 != null) {
            $element->setAttribute('time2', $this->_time2);
        }
        if ($this->_time3 != null) {
            $element->setAttribute('time3', $this->_time3);
        }
        if ($this->_time4 != null) {
            $element->setAttribute('time4', $this->_time4);
        }
        if ($this->_time5 != null) {
            $element->setAttribute('time5', $this->_time5);
        }
        if ($this->_time6 != null) {
            $element->setAttribute('time6', $this->_time6);
        }
        if ($this->_time7 != null) {
            $element->setAttribute('time7', $this->_time7);
        }
        if ($this->_time8 != null) {
            $element->setAttribute('time8', $this->_time8);
        }
        if ($this->_sec_avg != null) {
            $element->setAttribute('sec_avg', $this->_sec_avg);
        }
        if ($this->_sec_total != null) {
            $element->setAttribute('sec_total', $this->_sec_total);
        }
        if ($this->_last_request != null) {
            $element->setAttribute('last_request', $this->_last_request);
        }
        
        return $element;
    }

    /**
     * Creates individual Entry objects of the appropriate type and
     * stores them as members of this entry based upon DOM data.
     *
     * @param DOMNode $child The DOMNode to process
     */
    protected function takeChildFromDOM($child)
    {
        $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
        
        switch ($absoluteNodeName) {
            case $this->lookupNamespace('raws') . ':' . 'path'; 
                $path = new Rams_Extension_Path();
                $path->transferFromDOM($child);
                $this->_path = $path;
                break;
            case $this->lookupNamespace('raws') . ':' . 'volume'; 
                $volume = new Rams_Extension_Volume();
                $volume->transferFromDOM($child);
                $this->_volume = $volume;
                break;
            case $this->lookupNamespace('raws') . ':' . 'hits'; 
                $hits = new Rams_Extension_Hits();
                $hits->transferFromDOM($child);
                $this->_hits = $hits;
                break;
            case $this->lookupNamespace('raws') . ':' . 'updated'; 
                $updated = new Rams_Extension_Updated();
                $updated->transferFromDOM($child);
                $this->_updated = $updated;
                break;

            case $this->lookupNamespace('raws') . ':' . 'pct_0_10'; 
                $pct_0_10 = new Rams_Extension_Pct_0_10();
                $pct_0_10->transferFromDOM($child);
                $this->_pct_0_10 = $pct_0_10;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_10_20'; 
                $pct_10_20 = new Rams_Extension_Pct_10_20();
                $pct_10_20->transferFromDOM($child);
                $this->_pct_10_20 = $pct_10_20;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_20_30'; 
                $pct_20_30 = new Rams_Extension_Pct_20_30();
                $pct_20_30->transferFromDOM($child);
                $this->_pct_20_30 = $pct_20_30;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_30_40'; 
                $pct_30_40 = new Rams_Extension_Pct_30_40();
                $pct_30_40->transferFromDOM($child);
                $this->_pct_30_40 = $pct_30_40;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_40_50'; 
                $pct_40_50 = new Rams_Extension_Pct_40_50();
                $pct_40_50->transferFromDOM($child);
                $this->_pct_40_50 = $pct_40_50;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_50_60'; 
                $pct_50_60 = new Rams_Extension_Pct_50_60();
                $pct_50_60->transferFromDOM($child);
                $this->_pct_50_60 = $pct_50_60;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_60_70'; 
                $pct_60_70 = new Rams_Extension_Pct_60_70();
                $pct_60_70->transferFromDOM($child);
                $this->_pct_60_70 = $pct_60_70;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_70_80'; 
                $pct_70_80 = new Rams_Extension_Pct_70_80();
                $pct_70_80->transferFromDOM($child);
                $this->_pct_70_80 = $pct_70_80;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_80_90'; 
                $pct_80_90 = new Rams_Extension_Pct_80_90();
                $pct_80_90->transferFromDOM($child);
                $this->_pct_80_90 = $pct_80_90;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_90_100'; 
                $pct_90_100 = new Rams_Extension_Pct_90_100();
                $pct_90_100->transferFromDOM($child);
                $this->_pct_90_100 = $pct_90_100;
                break;
            case $this->lookupNamespace('raws') . ':' . 'pct_unknown'; 
                $pct_unknown = new Rams_Extension_Pct_Unknown();
                $pct_unknown->transferFromDOM($child);
                $this->_pct_unknown = $pct_unknown;
                break;

            case $this->lookupNamespace('raws') . ':' . 'time0'; 
                $time0 = new Rams_Extension_Time0();
                $time0->transferFromDOM($child);
                $this->_time0 = $time0;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time1'; 
                $time1 = new Rams_Extension_Time1();
                $time1->transferFromDOM($child);
                $this->_time1 = $time1;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time2'; 
                $time2 = new Rams_Extension_Time2();
                $time2->transferFromDOM($child);
                $this->_time2 = $time2;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time3'; 
                $time3 = new Rams_Extension_Time3();
                $time3->transferFromDOM($child);
                $this->_time3 = $time3;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time4'; 
                $time4 = new Rams_Extension_Time4();
                $time4->transferFromDOM($child);
                $this->_time4 = $time4;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time5'; 
                $time5 = new Rams_Extension_Time5();
                $time5->transferFromDOM($child);
                $this->_time5 = $time5;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time6'; 
                $time6 = new Rams_Extension_Time6();
                $time6->transferFromDOM($child);
                $this->_time6 = $time6;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time7'; 
                $time7 = new Rams_Extension_Time7();
                $time7->transferFromDOM($child);
                $this->_time7 = $time7;
                break;
            case $this->lookupNamespace('raws') . ':' . 'time8'; 
                $time8 = new Rams_Extension_Time8();
                $time8->transferFromDOM($child);
                $this->_time8 = $time8;
                break;
            case $this->lookupNamespace('raws') . ':' . 'sec_total'; 
                $sec_total = new Rams_Extension_SecTotal();
                $sec_total->transferFromDOM($child);
                $this->_sec_total = $sec_total;
                break;
            case $this->lookupNamespace('raws') . ':' . 'sec_avg'; 
                $sec_avg = new Rams_Extension_SecAvg();
                $sec_avg->transferFromDOM($child);
                $this->_sec_avg = $sec_avg;
                break;
            case $this->lookupNamespace('raws') . ':' . 'last_request'; 
                $last_request = new Rams_Extension_LastRequest();
                $last_request->transferFromDOM($child);
                $this->_last_request = $last_request;
                break;
              
            default:
                parent::takeChildFromDOM($child);
                break;
        }
    }
    
    public function getPath()
    {
        return $this->_path;
    }

    public function setPath($value)
    {
        $this->_path = $value;
        return $this;
    }

    public function getVolume()
    {
        return $this->_volume;
    }

    public function setVolume($value)
    {
        $this->_volume = $value;
        return $this;
    }

    public function getHits()
    {
        return $this->_hits;
    }

    public function setHits($value)
    {
        $this->_hits = $value;
        return $this;
    }

    public function getUpdated()
    {
        return $this->_updated;
    }

    public function setUpdated($value)
    {
        $this->_updated = $value;
        return $this;
    }

    public function getPct_0_10()
    {
        return $this->_pct_0_10;
    }

    public function setPct_0_10($value)
    {
        $this->_pct_0_10 = $value;
        return $this;
    }

    public function getPct_10_20()
    {
        return $this->_pct_10_20;
    }

    public function setPct_10_20($value)
    {
        $this->_pct_10_20 = $value;
        return $this;
    }

    public function getPct_20_30()
    {
        return $this->_pct_20_30;
    }

    public function setPct_20_30($value)
    {
        $this->_pct_20_30 = $value;
        return $this;
    }

    public function getPct_30_40()
    {
        return $this->_pct_30_40;
    }

    public function setPct_30_40($value)
    {
        $this->_pct_30_40 = $value;
        return $this;
    }

    public function getPct_40_50()
    {
        return $this->_pct_40_50;
    }

    public function setPct_40_50($value)
    {
        $this->_pct_40_50 = $value;
        return $this;
    }

    public function getPct_50_60()
    {
        return $this->_pct_50_60;
    }

    public function setPct_50_60($value)
    {
        $this->_pct_50_60 = $value;
        return $this;
    }

    public function getPct_60_70()
    {
        return $this->_pct_60_70;
    }

    public function setPct_60_70($value)
    {
        $this->_pct_60_70 = $value;
        return $this;
    }

    public function getPct_70_80()
    {
        return $this->_pct_70_80;
    }

    public function setPct_70_80($value)
    {
        $this->_pct_70_80 = $value;
        return $this;
    }

    public function getPct_80_90()
    {
        return $this->_pct_80_90;
    }

    public function setPct_80_90($value)
    {
        $this->_pct_80_90 = $value;
        return $this;
    }

    public function getPct_90_100()
    {
        return $this->_pct_90_100;
    }

    public function setPct_90_100($value)
    {
        $this->_pct_90_100 = $value;
        return $this;
    }
    
    public function getPct_Unknown()
    {
        return $this->_pct_unknown;
    }

    public function setPct_Unknown($value)
    {
        $this->_pct_unknown = $value;
        return $this;
    }

    public function getTime0()
    {
        return $this->_time0;
    }

    public function setTime0($value)
    {
        $this->_time0 = $value;
        return $this;
    }
    
    public function getTime1()
    {
        return $this->_time1;
    }

    public function setTime1($value)
    {
        $this->_time1 = $value;
        return $this;
    }

    public function getTime2()
    {
        return $this->_time2;
    }

    public function setTime2($value)
    {
        $this->_time2 = $value;
        return $this;
    }
    
    public function getTime3()
    {
        return $this->_time3;
    }

    public function setTime3($value)
    {
        $this->_time3 = $value;
        return $this;
    }

    public function getTime4()
    {
        return $this->_time4;
    }

    public function setTime4($value)
    {
        $this->_time4 = $value;
        return $this;
    }
    
    public function getTime5()
    {
        return $this->_time5;
    }

    public function setTime5($value)
    {
        $this->_time5 = $value;
        return $this;
    }

    public function getTime6()
    {
        return $this->_time6;
    }

    public function setTime6($value)
    {
        $this->_time6 = $value;
        return $this;
    }
    
    public function getTime7()
    {
        return $this->_time7;
    }

    public function setTime7($value)
    {
        $this->_time7 = $value;
        return $this;
    }

    public function getTime8()
    {
        return $this->_time8;
    }

    public function setTime8($value)
    {
        $this->_time8 = $value;
        return $this;
    }
    
    public function getSecAvg()
    {
        return $this->_sec_avg;
    }

    public function setSecAvg($value)
    {
        $this->_sec_avg = $value;
        return $this;
    }
    
    public function getSecTotal()
    {
        return $this->_sec_total;
    }

    public function setSecTotal($value)
    {
        $this->_sec_total = $value;
        return $this;
    }

    public function getLastRequest()
    {
        return $this->_last_request;
    }

    public function setLastRequest($value)
    {
        $this->_last_request = $value;
        return $this;
    }

}
